//
//  YveTXViewController.m
//  ShangChengMoBan
//
//  Created by yaoqi yaoqi on 16/11/1.
//  Copyright © 2016年 ping. All rights reserved.
//

#import "YveTXViewController.h"
#import "YEJLViewController.h"
#import "YuEPayView.h"
#import "YE_wcViewController.h"
@interface YveTXViewController ()<MimaViewDelegate>
@property (weak, nonatomic) IBOutlet UILabel *money;
@property (weak, nonatomic) IBOutlet UITextField *jine;
@property (weak, nonatomic) IBOutlet UITextField *yinHang;
@property (weak, nonatomic) IBOutlet UITextField *name;
@property (weak, nonatomic) IBOutlet UITextField *kaHao;
@property (weak, nonatomic) IBOutlet UIButton *xiaBu;
- (IBAction)xiaBu:(id)sender;
- (IBAction)xuanYinHang:(id)sender;

@end

@implementation YveTXViewController
{
    YuEPayView *_homeView;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    [self drawNavWithTitle:@"余额提现" WithColor:[UIColor colorWithHue:0.00 saturation:0.00 brightness:1.00 alpha:1.00]];
    [self drawBackButton];
    self.view.backgroundColor = [UIColor colorWithHue:0.73 saturation:0.03 brightness:0.96 alpha:1.00];
    UIButton * guiButton = [[UIButton alloc]initWithFrame:CGRectMake(KScreenWidth-50, 20, 50, 44)];
    [guiButton setTitle:@"记录" forState:UIControlStateNormal];
    [guiButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    guiButton.titleLabel.font=[UIFont systemFontOfSize:15];
    [guiButton addTarget:self action:@selector(guiButton) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:guiButton];

    UIView * view = [[[NSBundle mainBundle]loadNibNamed:@"TETX" owner:self options:nil] lastObject];
    view.backgroundColor = [UIColor colorWithHue:0.73 saturation:0.03 brightness:0.96 alpha:1.00];
    view.frame = CGRectMake(0, 64, KScreenWidth, 351);
    [self.view addSubview:view];
    _xiaBu.layer.cornerRadius = 3;
    _xiaBu.layer.masksToBounds =  YES;
    [self tanKuang];
}
-(void)queMiMaEnd{
    _homeView.hidden = YES;
    _homeView.alpha = 0.0;
    NSMutableDictionary * dic = [[NSMutableDictionary alloc]init];
    YE_wcViewController *y = [[YE_wcViewController alloc]init];
    [self.navigationController pushViewController:y animated:YES];
    [NetWorking NEWjieKouQingQiu:@"" ANDIP:IP And:dic anBlock:^(NSDictionary *dic, NSError *error) {
        if (!error) {
            if ([dic[Code] intValue] == 200) {
                YE_wcViewController *y = [[YE_wcViewController alloc]init];
                [self.navigationController pushViewController:y animated:YES];
            }
        }
    }];

}

-(void)tanKuang{
    _homeView = [[YuEPayView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
    _homeView.delegate = self;
    [self.view addSubview:_homeView];
}
#pragma mark 记录页
-(void)guiButton{
    YEJLViewController * ye_jie = [[YEJLViewController alloc]init];
    [self.navigationController pushViewController:ye_jie animated:YES];
}
- (IBAction)xiaBu:(id)sender {
    if (_jine.text.length ==0 ||_yinHang.text.length ==0 || _name.text.length ==0 || _kaHao.text.length == 0 ) {
         [[iToast makeText:@"  请完善信息!  "] show];
        return;
    }
    [_homeView.inputTextField becomeFirstResponder];
    _homeView.hidden = NO;
    [UIView animateWithDuration:0.5 animations:^{
          _homeView.alpha = 1.0;
    }];
}

- (IBAction)xuanYinHang:(id)sender {
}
@end
